<?php
/**
 * 模型
 * @author 41412754@qq.com
 */
class model {
	
	public $app;
	public $group;
	public $config;
	
	public $get;
	public $post;
	public $request;
	
	public $db;
	
	public function __construct()
	{
		$this->app = &$GLOBALS['app'];
		$this->group = &$this->app->group;
		$this->config = &$this->app->config;
		
		$this->get = &$_GET;
		$this->post = &$_POST;
		$this->request = &$_REQUEST;
		$this->session = &$_SESSION;
		$this->cookie = &$_COOKIE;
		
		$this->db = $this->app->db;
	}
	
	/**
	 * 加载其他模型
	 * @param $model
	 */
	public function loadModel( $model )
	{
		control::loadModel( $model );
	}
	
	/**
	 * 加截类
	 * @param $className
	 * @param $static 可选
	 */
	public function loadClass( $className, $static = false )
	{
		$this->$className = $this->app->loadClass( $className, $static );
	}
}